package com.shop.www.task;

import com.shop.www.dao.CommodityDAO;
import com.shop.www.dao.Impl.CommodityDAOImpl;
import com.shop.www.model.Commodity;
import com.shop.www.service.Commodityservice;
import com.shop.www.service.Impl.CommodityserviceImpl;

import java.util.TimerTask;

public class myTimerTask extends TimerTask {


    private Commodityservice commodityservice;
    private Integer commodity_ID;
    private String state;

    public myTimerTask() {
    }

    public myTimerTask(Integer commodity_ID, String state) {

        super();
        this.commodity_ID = commodity_ID;
        this.state = state;
    }


    @Override
    public void run() {
        CommodityDAO commodityDAO = new CommodityDAOImpl();
        commodityDAO.updatecommoditystate(new Commodity(commodity_ID,state));
    }


}
